package com.hzgj.bcl.soa.registry;


import com.hzgj.bcl.soa.config.ReferenceDef;
import com.hzgj.bcl.soa.config.ServiceDef;

import java.util.Collection;

/**
 * Created by dell on 2015/3/25.
 */
public interface Registry {


    /**
     * 注册服务
     */
    void registryService(RegistryContext.ServerRegisterModel serverDef, boolean refreshTtl);

    /**
     * 查询服务
     */
    ServiceDef lookupService(String name);

    /**
     * 客户端刷新订阅
     */
    void notifyClient(String service);


    boolean needLoopPullService();

    /**
     * 客户端订阅服务
     */
    void subscribe(NotifyListener listener, ReferenceDef... referenceDefs);

    /**
     * 客户端解绑订阅
     */
    void unSubscribe(ReferenceDef... referenceDefs);

    /**
     * 更新客户端信息
     * @param referenceDefs
     */

    void updateClient(Collection<ReferenceDef> referenceDefs);
}
